package com.ruoyi.vehicle.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.vehicle.mapper.RouteInfoMapper;
import com.ruoyi.vehicle.domain.RouteInfo;
import com.ruoyi.vehicle.service.IRouteInfoService;

/**
 * 线路信息主Service业务层处理
 * 
 * @author yyj
 * @date 2025-08-16
 */
@Service
public class RouteInfoServiceImpl implements IRouteInfoService 
{
    @Autowired
    private RouteInfoMapper routeInfoMapper;

    /**
     * 查询线路信息主
     * 
     * @param routeId 线路信息主主键
     * @return 线路信息主
     */
    @Override
    public RouteInfo selectRouteInfoByRouteId(Long routeId)
    {
        return routeInfoMapper.selectRouteInfoByRouteId(routeId);
    }

    /**
     * 查询线路信息主列表
     * 
     * @param routeInfo 线路信息主
     * @return 线路信息主
     */
    @Override
    public List<RouteInfo> selectRouteInfoList(RouteInfo routeInfo)
    {
        return routeInfoMapper.selectRouteInfoList(routeInfo);
    }

    /**
     * 新增线路信息主
     * 
     * @param routeInfo 线路信息主
     * @return 结果
     */
    @Override
    public int insertRouteInfo(RouteInfo routeInfo)
    {
        routeInfo.setCreateTime(DateUtils.getNowDate());
        return routeInfoMapper.insertRouteInfo(routeInfo);
    }

    /**
     * 修改线路信息主
     * 
     * @param routeInfo 线路信息主
     * @return 结果
     */
    @Override
    public int updateRouteInfo(RouteInfo routeInfo)
    {
        routeInfo.setUpdateTime(DateUtils.getNowDate());
        return routeInfoMapper.updateRouteInfo(routeInfo);
    }

    /**
     * 批量删除线路信息主
     * 
     * @param routeIds 需要删除的线路信息主主键
     * @return 结果
     */
    @Override
    public int deleteRouteInfoByRouteIds(Long[] routeIds)
    {
        return routeInfoMapper.deleteRouteInfoByRouteIds(routeIds);
    }

    /**
     * 删除线路信息主信息
     * 
     * @param routeId 线路信息主主键
     * @return 结果
     */
    @Override
    public int deleteRouteInfoByRouteId(Long routeId)
    {
        return routeInfoMapper.deleteRouteInfoByRouteId(routeId);
    }
}
